tools/coreutils: add maintainer-clean to clean target
authorMichael Pratt <[email protected]>
Fri, 27 Sep 2024 03:30:51 +0000 (23:30 -0400)
committerRobert Marko <[email protected]>
Sat, 26 Jul 2025 12:38:08 +0000 (14:38 +0200)
commit6a3cfeb4a66763630cca9cb100ec86f5fddbd79b
treeae6d3af25d17d7412954615b2bb9d4b3b8127212
parent26f8a3874b1d1a393cbd081b4e5a05a5aa3b534c
tools/coreutils: add maintainer-clean to clean target

Use the clean recipe during build, so that files already
generated by the bootstrapping within the release are removed
before the bootstrap script is run again.

Automake with modified rules must be ran
in order to generate a Makefile that does not delete itself.

Override an automake variable "am__CONFIG_DISTCLEAN_FILES"
in order to prevent removing config.status and other configure files
so that configure stage does not need to be ran twice.

Redefine MAINTAINERCLEANFILES with Make functions
to avoid deleting the targets of gettext and gperf rules.

In order to prevent an inconsistent state of `install`
since this utility must always be available as a prerequisite,
do not allow it to be removed.

Instead of preventing the removal of the config.h header,
the Makefile supports regenerating it quickly.

Tested-by: Georgi Valkov <[email protected]> # macOS
Signed-off-by: Michael Pratt <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <[email protected]>
tools/coreutils/Makefile